
'use strict'
import { View } from '../../../component'
import style from './css.css'

class Choose extends React.Component {
  static propTypes = {
    transferShow: PropTypes.func,
    history: PropTypes.object
  }
  _closeRecharge = this._closeRecharge.bind(this)
  _handleCharge = this._handleCharge.bind(this)
  componentDidMount () {

  }
  _handleCharge () {
    // const { money } = this.props
    // // console.log(money)
    // const param = Mustparameter()
    // param.money = money
    // param.token = Cookies.get('token')
    // param.did = Cookies.get('uuid')
    // const sigObj = sigFunc(param)
    // const fetchURL = `/v1/doll/touch/ali/charge/web?sig=${sigObj.sig}&${sigObj.str}`
    // const credentials = __DEV__ ? 'include' : 'same-origin'
    // fetch(fetchURL, { method: 'get', credentials: credentials, headers: { 'Content-Type': 'application/json' }})
    //   .then(res => res.json())
    //   .then(res => {
    //     console.log(res)
    //     if (res.err === 0) { window.location.href = res.res }
    //   })
    //   .catch((err) => { this.setState({ loading: false }) })
  }
  _closeRecharge () {
    this.props.transferShow(false)
  }
  render () {
    return (
      <View className={style.chooseApp} tap={() => this._closeRecharge()}>
        <View className={style.chooseWrap}>
          <View className={style.chooseText}>请选择支付方式</View>
          {/* <div className={style.choosew}></div> */}
          <View className={style.chooset} tap={ this._handleCharge }></View>
        </View>
      </View>
    )
  }
}

export default Choose
